package Tools 
{
	import flash.utils.Timer;
	
	import flash.events.TimerEvent;

    public class GameTimer 
	{
        public var ticker:Timer;
		public var func:Function;

        public function GameTimer(delay:int, _func:Function)
		{
            ticker = new Timer(delay);
            ticker.addEventListener(TimerEvent.TIMER, onTick);
            func = _func;
            ticker.start();
        }
		public function onTick(event:TimerEvent):void
		{
            func();
        }

    }
}